Skip to content

Instantly share code, notes, and snippets.

@msrose
msrose / combining-git-repositories.md
Last active May 8, 2024 22:35
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@0xOsprey
0xOsprey / raycastParseAndOpen.py
Created May 6, 2024 18:07
Raycast Python script for parsing clipboard and opening a link
#!/usr/bin/python3
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Parse and Open
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🔍
# @raycast.packageName Developer Util
@hal0gen
hal0gen / _mobile-ready-web-app.html
Last active May 8, 2024 22:32 — forked from tfausak/ios-8-web-app.html
iOS + Android settings for web applications
<!doctype html>
<!-- Adapted from https://gist.github.com/tfausak/2222823 -->
<html>
<head>
<title>Mobile-ready web app</title>
<!-- CONFIGURATION -->
@Aldaviva
Aldaviva / wmp_h.265_hevc.md
Last active May 8, 2024 22:30
Play H.265/HEVC videos in Windows Media Player (Classic) without a third-party codec pack or media player. Tested using Microsoft.HEVCVideoExtension_2.0.60091.0_x64__8wekyb3d8bbwe with WMP 12.0.20348.1311 on Windows Server 2022 21H2 and 12.0.22621.1105 on Windows 11 22H2.

Download

  1. Go to https://store.rg-adguard.net.
  2. Search for the HEVC Video Extensions from Device Manufacturer (Microsoft.HEVCVideoExtension) app by entering the following store URL.
    https://www.microsoft.com/en-us/p/hevc-video-extensions-from-device-manufacturer/9n4wgh0z6vhq
    
    • Do not use the normal HEVC Video Extensions app URL, because that can't play HEVC videos in Windows Media Player for some inscrutable reason.
  3. Download the x64 appx file, or whatever your Windows architecture is.
    • You may have to right click › Save Link As because the URL scheme is http, not https, if your browser is set to enforce HTTPS-only mode.
  • If it tries to save as a filename that's just a GUID, you may copy the correct .appx filename and save it as that instead.
@vanga
vanga / create-self-signed-certs.sh
Created September 8, 2022 14:41
Create self signed certificates using Elasticsearch util scripts
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.4.1-linux-x86_64.tar.gz
tar -zxf elasticsearch-8.4.1-linux-x86_64.tar.gz
cd elasticsearch-8.4.1/
./bin/elasticsearch-certutil ca --pem
unzip elastic-stack-ca.zip
./bin/elasticsearch-certutil cert --ca-cert ca/ca.crt --ca-key ca/ca.key --pem --name elk.example.com
unzip certificate-bundle.zip
cd ../
@johnathanmay
johnathanmay / logitech-mx-master-3-extras-for-linux-with-logiops.md
Last active May 8, 2024 22:25
How to install and configure PixlOne's logid to program Logitech MX Master 3 buttons on Linux.

Logitech MX Master 3 Extras for Linux With logiops

The Logitech Options program isn't available for Linux, but by a nice guy on GitHub (PixlOne) created an open source project that lets you obtain some of that functionality. It's called logiops. It works in conjunction with the Solaar project as well, which I find especially handy since that shows your available battery life in the system tray and lets you pair/unpair devices with the Logitech Unifying Receiver.

Here are some additional pages with info that I used to generate this documentation:

@geovannaotoni
geovannaotoni / docker.md
Last active May 8, 2024 22:25
Comandos Docker

Principais Comandos do Docker via CLI

Gerenciando Imagens

  • docker images: visualizar todas as imagens Docker presentes na máquina;
  • docker pull <nome-da-imagem>:<tag>?: baixar uma imagem do Docker Hub sem necessariamente executar esta imagem como um container;
  • docker rmi <nome/id-da-imagem>: remover uma imagem Docker (acrônimo das palavras ReMover Imagem);
  • docker build: construir uma imagem a partir de um Dockerfile;

Gerenciando Container

  • docker <comando> <subcomando> <parâmetros>: (Os <parâmetros> são opcionais na execução dos comandos);
@ax3l
ax3l / noglobal.py
Last active May 8, 2024 22:23
Useful Noglobal in Python
# License:
# I hereby state this snippet is below "threshold of originality" where applicable (public domain).
#
# Otherwise, since initially posted on Stackoverflow, use as:
# CC-BY-SA 3.0 skyking, Glenn Maynard, Axel Huebl
# http://stackoverflow.com/a/31047259/2719194
# http://stackoverflow.com/a/4858123/2719194
import types
@edonosotti
edonosotti / formula.md
Created March 19, 2018 12:04
Microsoft Excel formula to convert ISO 8601 date with milliseconds resolution to time stamp

Formula

This will convert an ISO 8601 date such as: 2018-03-19T10:18:08.137747874Z

to a timestamp with milliseconds resolution: 1521454688137,00

Please note that the decimal part (,00) can be stripped away, milliseconds are the last three digits.

=(((DATEVALUE(LEFT(A1;10))+TIMEVALUE(MID(A1;12;8)))-DATE(1970;1;1))*86400000)+VALUE(MID(A1;FIND(".";A1)+1;3))
@yanknudtskov
yanknudtskov / functions.php
Created June 4, 2019 07:31
get_posts meta_query example
<?php
$posts = get_posts( array(
'numberposts' => -1,
'post_type' => 'student',
'post_status' => 'publish',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'acf_student_group',